<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- <script src="./add.js"></script> -->
    <!-- <script src="./sub.js" type="module"></script> -->
</head>
<body>
    <button id="btn">导入</button>
    <script type="module">
        import def,{a,compute} from "./add.js"
        console.log(a);
        let result = compute();
        console.log(result);
        console.log("add.js默认导出"+def)
        

        let btn = document.getElementById("btn")
        btn.addEventListener("click",()=>{
            let sub = import("./sub.js")
            console.log(sub)
            sub.then((module)=>{
                module.compute()
            })
        })
    </script>
</body>
</html>